home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 20
/
Cream of the Crop 20 (Terry Blount) (1996).iso
/
os2
/
htmle96b.zip
/
HM-PROG.INF
(
.txt
)
< prev
next >
Wrap
OS/2 Help File
|
1996-07-22
|
38KB
|
1,688 lines
ΓòÉΓòÉΓòÉ 1. HTML-Ed REXX Functions ΓòÉΓòÉΓòÉ
The following functions are available for use in your REXX Macros:
hmChangeFilename
hmCharFromLine
hmCharsToTags
hmClear
hmCloseFile
hmConvertSlashes
hmCopy
hmCurrentFile
hmCut
hmDelete
hmDeselectAll
hmDisableRefresh
hmEnableRefresh
hmExit
hmFind
hmGoToLine
hmInsert
hmInsertFile
hmLineFromChar
hmNew
hmOpen
hmOpenOutputWindow
hmPaste
hmQueryChanged
hmQueryFilename
hmQueryLineCount
hmQueryLineLength
hmQuerySel
hmQuerySelText
hmQueryTextLength
hmQueryWrap
hmRemoveTags
hmResetUndo
hmRingLeft
hmRingFiles
hmRingRight
hmSaveAll
hmSaveAs
hmSaveASCII
hmSaveCurrent
hmSaveOptions
hmSay
hmSelectAll
hmSetChanged
hmSetSel
hmSetWrap
hmStatusSay
hmSwitchTo
hmTagsCase
hmUndo
hmVersion
hmWrapAround
ΓòÉΓòÉΓòÉ <hidden> Introduction ΓòÉΓòÉΓòÉ
Welcome to the HTML-Ed Programmer's Reference!
HTML-Ed extends the REXX language with 52 new functions. These functions are
explained in this reference manual.
If this is the first time you have used the .HM Macro functions, please read
over this entire document before proceeding. Many of the functions have
important remarks that you should be aware of before using them.
Things to remember:
Name your HTML-Ed macros with an .HM extension. This is not strictly
necessary, but it will help you to tell apart normal REXX .CMD files and
REXX macros that use the HTML-Ed extended functions.
The .HM macro functions are very powerful - but power comes at a price.
The functions are not crash proof and you can crash HTML-Ed if you are
not careful. Always check the return codes a function returns (unless
there is only one possible return code) and take appropriate action. For
functions that require parameters, make sure you are passing it a correct
value.
Take special care that you do not enter an infinite loop. HTML-Ed will
not be able to recover from a stuck macro.
Your macro runs on HTML-Ed's main thread! (This will change in the
future). Therefore, while your macro is running you will not be able to
interact with any windows (the message queue will be "hung"). If your
macro is taking a long time to complete, or if it gets stuck in an
infinite loop, pressing Ctrl+ESC a few times should bring up a dialog
that will allow you to kill HTML-Ed (alternatively, you could use a
process killer such as Watchcat to kill HTML-Ed). It is a good idea to
make sure your macros are short.
An insertion point is just a number. "0" is the insertion point before
the first character in the editor. Take special care to ensure that any
insertion points you are using are valid - any time you insert or remove
any text the insertion points after the changed portion will be invalid.
Take extreme care when writing looping search/replace macros as it is
very easy to become stuck in an infinite loop.
Use hmSay instead of Say. If more than 32kb of text is written to stdout
HTML-Ed will appear to crash (in reality, HTML-Ed is waiting for the
macro to finish and the macro is waiting for the unnamed pipe to be
cleared - so nothing happens). This will be addressed in a future
version.
If you have problems:
Nothing appears to be happening!
.HM macros simply stop execution when there is an
error. When an error occurs, anything written to
stdout does not get copied to the output window (use
hmSay to overcome this problem). If you have a
syntax error in your program and you have been using
say instead of hmSay it may appear as if nothing has
happened.
You can use hmSay to help track down the problem.
One of the functions doesn't work as it should!
First, make sure you read (and re-read) all the
appropriate information in this manual. If the
problem persists, contact me.
Contacting the author:
HTML-Ed's author, Ian Prest, may be contacted in the following ways:
email: ianprest@connect.reach.net (put "HTML-Ed" somewhere on the
subject line)
snail mail:
Ian Prest
R.R.#1
Shannonville, Ontario
K0K 3A0
re: HTML-Ed
Visit the HTML-Ed Home Page on the internet!
http://www.wp.com/ianprest/htmled.html
ΓòÉΓòÉΓòÉ 1.1. hmChangeFilename ΓòÉΓòÉΓòÉ
Function: hmChangeFilename
Purpose: to change the filename of the current editor
Syntax: rc = hmChangeFilename(file)
file the new filename
Returns: 0
Remarks:
hmChangeFilename changes the name of the current file, but does not
save anything with the new filename, and does not alter the file's
"changed" flag.
hmChangeFilename is usually used after a call to hmSaveAs.
Example:
/* Save the file with a new filename */
call hmSaveAs "newfile.htm"
/* Update the titlebar's filename to reflect the change */
call hmChangeFilename "newfile.htm"
ΓòÉΓòÉΓòÉ 1.2. hmCharFromLine ΓòÉΓòÉΓòÉ
Function: hmCharFromLine
Purpose: to find the insertion point of the first character of a line
Syntax: ipt = hmCharFromLine(line)
line line number of interest
Returns: insertion point of the first character of line 'line'
Remarks:
Use hmCharFromLine to determine where a line starts.
Example:
/* example to "home" the cursor */
/* get cursor position */
ipt = hmQuerySel("cursor")
/* get current line */
line = hmLineFromChar(ipt)
/* find start of current line */
ipt = hmCharFromLine(line)
/* set cursor position */
call hmSetSel ipt,ipt
ΓòÉΓòÉΓòÉ 1.3. hmCharsToTags ΓòÉΓòÉΓòÉ
Function: hmCharsToTags
Purpose: to convert characters to HTML character identities
Syntax: rc = hmCharsToTags()
Returns:
0 No error
1 No text was selected
Remarks:
hmCharsToTags works exactly as the "Convert characters to tags" menu
function does, converting all the characters in the selected text to
their HTML equivilants.
Example:
/* Convert all special characters to tags */
call hmCharsToTags
ΓòÉΓòÉΓòÉ 1.4. hmClear ΓòÉΓòÉΓòÉ
Function: hmClear
Purpose: to delete the current selection
Syntax: rc = hmClear()
Returns: 0
Remarks:
Example:
/* delete the current selection */
call hmClear
ΓòÉΓòÉΓòÉ 1.5. hmCloseFile ΓòÉΓòÉΓòÉ
Function: hmCloseFile
Purpose: to close the current file
Syntax: rc = hmCloseFile()
Returns:
0 No error
1 Last file closed - HTML-Ed will now